{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}
	<js href="__PUBLIC__/js/admin/listTable.js"/>
	<js href="__PUBLIC__/js/admin/js.util.js"/>
	<css href="__PUBLIC__/Css/admin/common.css"/>
	
	<css href="__PUBLIC__/css/jquery-ui.css" />
	<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->
<!-- [filter_user_list] -->
	<include file="Library:user_list"/>
<!-- [filter_user_list] -->

<form method="POST" action="" name="listForm" onsubmit="return confirm_bath()">
	<!-- start users list -->
	<div class="list-div" id="listDiv">
		<!--用户列表部分-->
		<table class="table" cellpadding="3" cellspacing="1" width="100%">
			<tr>
				<th>
					<input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
					<a href="javascript:listTable.sort('user_id'); ">编号</a>{$sort_user_id}
				</th>
				<th><a href="javascript:listTable.sort('user_name'); ">会员名称</a>{$sort_user_name}</th>
				<th><a href="javascript:listTable.sort('email'); ">邮件地址</a>{$sort_email}</th>
				<th><a href="javascript:listTable.sort('is_validated'); ">是否已验证</a>{$sort_is_validate}</th>
				<th>可用资金</th>
				<th>冻结资金</th>
				<th>等级积分</th>
				<th>消费积分</th>
				<th><a href="javascript:listTable.sort('reg_time'); ">注册日期</a>{$sort_reg_time}</th>
				<th>操作</th>
			</tr>
			<volist name="user_list" id="user">
			<tr>
				<td>
					<input type="checkbox" name="checkboxes[]" value="{$user.user_id}" notice="<if condition="$user['user_money'] eq 0">1<else/>0</if>"/>
					{$user.user_id}
				</td>
				<td class="first-cell">{$user.user_name}</td>
				<td>
					<span onclick="listTable.edit(this, 'edit_email', {$user.user_id})">{$user.email}</span>
				</td>
				<td align="center">
					<if condition="$user['is_validated']">
						<img src="__PUBLIC__/Image/admin/yes.gif"> 
					<else/>
						<img src="__PUBLIC__/Image/admin/no.gif"> 
					</if>
				</td>
				<td>{$user.user_money}</td>
				<td>{$user.frozen_money}</td>
				<td>{$user.rank_points}</td>
				<td>{$user.pay_points}</td>
				<td align="center">{$user.reg_time}</td>
				<td align="center">
					<a href="__URL__/user_edit?id={$user.user_id}" title="编辑">
						<img src="__PUBLIC__/Image/admin/icon_edit.gif" border="0" height="16" width="16" />
					</a>
					<a href="__URL__/user_address_list?id={$user.user_id}" title="收获地址">
						<img src="__PUBLIC__/Image/admin/book_open.gif" border="0" height="16" width="16" />
					</a>
					<a href="__APP__/order/order_list?user_id={$user.user_id}" title="查看订单">
						<img src="__PUBLIC__/Image/admin/icon_view.gif" border="0" height="16" width="16" />
					</a>
					<a href="__URL__/user_account_list?user_id={$user.user_id}" title="查看账目详细">
						<img src="__PUBLIC__/Image/admin/icon_account.gif" border="0" height="16" width="16" />
					</a>
					<!--
					<a href="javascript:confirm_redirect('<if condition="$user['user_money']">{$lang.still_accounts}</if>{$lang.remove_confirm}', '__URL__/remove?id={$user.user_id}')" title="移除">
						<img src="__PUBLIC__/Image/admin/icon_drop.gif" border="0" height="16" width="16" />
					</a>
					-->
					<a href="__URL__/remove?id={$user.user_id}" title="移除">
						<img src="__PUBLIC__/Image/admin/icon_drop.gif" border="0" height="16" width="16" />
					</a>					
					<a href="__URL__/allot_user_access?id={$user.user_id}" title="分配权限">
						分配权限
					</a>
				</td>
			</tr>
			</volist>
			<tr>
				<td colspan="2">
					<input type="hidden" name="act" value="batch_remove" />
					<input type="submit" class="btn btn-default" id="btnSubmit" value="删除" disabled="true" />
				</td>
				<td align="right" nowrap="true" colspan="8"></td>
			</tr>
		</table>
		<include file="Library:paginator"/>
	</div>
</form>

<script type="text/javascript" language="JavaScript">

	onload = function(){
		document.forms['searchForm'].elements['keyword'].focus();
		// 开始检查订单
		//startCheckOrder();
	}
	/**
	 * 搜索用户
	 */
	function searchUser(){
		listTable.filter['keywords'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
		listTable.filter['rank'] = document.forms['searchForm'].elements['user_rank'].value;
		listTable.filter['pay_points_gt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_gt'].value);
		listTable.filter['pay_points_lt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_lt'].value);
		listTable.filter['page'] = 1;
		listTable.loadList();
	}
	function confirm_bath(){
	  userItems = document.getElementsByName('checkboxes[]');
	  cfm = '{$lang.list_remove_confirm}';
	  for (i=0; userItems[i]; i++){
		if (userItems[i].checked && userItems[i].notice == 1){
		  cfm = '{$lang.list_still_accounts}' + '{$lang.list_remove_confirm}';
		  break;
		}
	  }
	  return confirm(cfm);
	}

</script>